package cn.devil.two.beans

class DevilString  (val str: String) {
  def toInt2 = try {
    str.toInt
  } catch {
    case _: Exception => 0
  }

  def toDouble2 = try {
    str.toDouble
  } catch {
    case _: Exception => 0d
  }
}
  object DevilString {
    //隐式转换
    implicit def str2DevilString(str: String) =  new DevilString(str)
  }

